package com.xxx.service;

import com.xxx.entry.Student;

import java.util.Scanner;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/7/13 13:40
 * @Copyright 博为峰
 */
public class StudentService {

    //ALT + ENTER
    public void addStu(Scanner scanner, Student[] stus, int index) {
        System.out.println("请输入用户名");
        Student student = new Student();
        student.setName(scanner.nextLine());
        System.out.println("请输入年龄");
        student.setAge(Integer.parseInt(scanner.nextLine()));
        System.out.println("请输入性别");
        student.setSex(scanner.nextLine());
        stus[index] = student;
        index++;
    }
}
